package com.javaee.term.service.iml;

import com.javaee.term.data.ConverAnaly;
import com.javaee.term.data.TurnOver;
import com.javaee.term.mapper.SaleManMapper;
import com.javaee.term.model.SaleMan;
import com.javaee.term.service.SalemanService;
import com.javaee.term.service.base.BaseServiceIml;
import org.springframework.stereotype.Service;

import java.sql.SQLOutput;
import java.util.List;

/**
 * author 陈伯瑞
 * date 2019/12/17 0017 19:12
 * version 1.0
 **/
@Service
public class SalemanServiceIml extends BaseServiceIml implements SalemanService {
    @Override
    public SaleMan findOne(Object id) {
        return saleManMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SaleMan> findAll() {
        return saleManMapper.selectAll();
    }

    @Override
    public void delete(Object id) {
         saleManMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(SaleMan saleMan) {
        return saleManMapper.insert(saleMan);
    }

    @Override
    public int update(SaleMan saleMan) {
        return saleManMapper.updateByPrimaryKey(saleMan);
    }

    @Override
    public List<TurnOver>   getAllSalesmanTurnOver() {
        return saleManMapper.getAllSalesmanTurnOver();
    }

    @Override
    public List<TurnOver>  getTheSumEachYear(int id) {
        return saleManMapper.getTheSumEachYear(id);
    }

    @Override
    public List<TurnOver>  getTheSumEachMouth(String year, int id) {
        return saleManMapper.getTheSumEachMouth(year,id);
    }

    @Override
    public SaleMan findByAccount(String account) {
        return saleManMapper.findByAccount(account);
    }
}
